﻿using System;
using System.Collections.Generic;
using XRM.Security.DataAccess.Enums;
using XRM.Security.WebUI.Models.Common;

namespace XRM.Security.WebUI.Models.Request
{
    public class RequestSearchItem : SearchItemBase
    {
        public int Number { get; set; }
        public string Department { get; set; }
        public string DepartmentAddress { get; set; }
        public RequestStatus Status { get; set; }
        public DateTime CreateDate { get; set; }
        public DateTime? Deadline { get; set; }
        public DateTime? CloseDate { get; set; }
        public List<string> WorkKinds { get; set; }

        public string StatusIcon
        {
            get
            {
                if ( Status == RequestStatus.Closed )
                    return "fa-check";
                return Deadline == null || DateTime.Today <= Deadline ? "fa-play" : "fa-exclamation-circle";
            }
        }
    }
}